<extend name="Common@Layout:hui-admin" />
<block name="title"><title>应用私有用户-管理员管理-Administator管理后台</title></block>
<block name="style">
</block>

<block name="main">
	<nav class="breadcrumb">
		<i class="Hui-iconfont"></i>
		 首页 <span class="c-gray en">&gt;</span>
		 管理员管理 <span class="c-gray en">&gt;</span>  
		 邀请码
		<a class="btn btn-success radius r mr-20" style="line-height:1.6em;margin-top:3px" href="javascript:location.replace(location.href);" title="刷新"><i class="Hui-iconfont"></i></a>
	</nav>
	
	<div class="pd-20">
		<div class="text-c"> 
			<form action="/Users/Invitecodeadmin" method="get">
			 日期范围：
			<input type="text" name="start_time" value="{$_GET['start_time']}" class="input-text mini-time" style="width:120px;">
			-
			<input type="text" name="end_time" value="{$_GET['end_time']}" class="input-text mini-time" style="width:120px;">
			<input type="hidden" name="searchtype" value="invite_code">
			<input type="text" name="keywords" value="{$_GET['keywords']}" id="" placeholder="关键词" style="width:250px" class="input-text">
			<button name="" id="" class="btn btn-success" type="submit"><i class="Hui-iconfont"></i> 搜索</button>
			</form>
		</div>
		<div class="cl pd-5 bg-1 bk-gray mt-20"> 
			<span class="l"> 
				<a href="javascript:;" class="btn btn-danger radius ajax-post confirm" target-form="mini-form" data-msg="确定批量删除？" data-url="/Users/Invitecodeadmin/del.html"><i class="Hui-iconfont"></i> 批量删除</a> 
				<a class="btn btn-primary radius" href="javascript:;" onclick="open_iframe_dialog('{:U('Invitecodeadmin/add')}','生成邀请码',['650px','300px'],1)"><i class="Hui-iconfont"></i> 生成邀请码</a> 
			</span> 
		</div>
		<php>
			$result = _get_list_data('/Users/Invitecodeadmin',$_GET,$map,D('UsersInvitation'));
		</php>
		<form class="mini-form">
		<table class="table table-border table-bordered table-hover table-bg mini-sort">
			<thead>
				<tr>
					<th scope="col" colspan="12">应用管理</th>
				</tr>
				<tr class="text-c">
					<th width="25"><input type="checkbox" value="" name=""></th>
					<th width="40">ID</th>
					<th>邀请码</th>
					<th width="200">生成时间</th>
					<th width="200">更新时间</th>
					<th width="100">状态</th>
					<th width="70">操作</th>
				</tr>
			</thead>
			<tbody>
				<foreach name="result['data']['list']" item="vo">
				<tr class="text-c">
					<td><input type="checkbox" value="{$vo.id}" name="ids[]"></td>
					<td>{$vo.id}</td>
					<td>{:replace_query_str($_GET['keywords'],$vo['invite_code'])}</td>
					<td>{$vo.create_time}</td>
					<td>{$vo.update_time}</td>
					<td>
            			<if condition="$vo.hasuse eq 1"><span class="c-green">已使用</span><else/><span class="c-red">未使用</span></if>
					</td>
					<td class="f-14">
						<if condition="$vo.hasuse eq 1">
            			<a style="text-decoration:none" class="ml-5 ajax-get shuaxin" data-url="{:U('Invitecodeadmin/changestatus','id='.$vo['id'].'&status=2')}" href="javascript:;" title="未使用"><i class="Hui-iconfont"></i></a>
            			<else/>
            			<a style="text-decoration:none" class="ml-5 ajax-get shuaxin" data-url="{:U('Invitecodeadmin/changestatus','id='.$vo['id'].'&status=1')}" href="javascript:;" title="已使用"><i class="Hui-iconfont"></i></a>
            			</if>
            			<a style="text-decoration:none" class="ml-5 mini_del" data-url="{:U('Invitecodeadmin/del','ids='.$vo['id'])}" href="javascript:;" title="删除"><i class="Hui-iconfont"></i></a>
					</td>
				</tr>
				</foreach>
			</tbody>
		</table>
		</form>
		{$result['pagetpl']}
	</div>
</block>

<block name="script">
<script>
$(function(){
	$('.mini-time').datepicker();
});
</script>
</block>